package com.woniu.command.workCommand;

import com.woniu.command.Command;
import com.woniu.command.handler.WorkerCommandHandler;
import com.woniu.utils.ApplicationContextHolder;

public class DeleteWorkerCommand implements Command<Long,Integer> {

    private WorkerCommandHandler handler;
    public DeleteWorkerCommand(){
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(WorkerCommandHandler.class);
    }
    @Override
    public Integer  execute(Long id) {
        return handler.deleteWorkerById(id);
    }
}
